import 'package:high_help_apps/common/entities/life_help/message_info_entity.dart';

messageInfoEntityFromJson(MessageInfoEntity data, Map<String, dynamic> json) {
	if (json['success'] != null) {
		data.success = json['success'];
	}
	if (json['code'] != null) {
		data.code = json['code'] is String
				? int.tryParse(json['code'])
				: json['code'].toInt();
	}
	if (json['message'] != null) {
		data.message = json['message'].toString();
	}
	if (json['detail'] != null) {
		data.detail = MessageInfoDetail().fromJson(json['detail']);
	}
	return data;
}

Map<String, dynamic> messageInfoEntityToJson(MessageInfoEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['success'] = entity.success;
	data['code'] = entity.code;
	data['message'] = entity.message;
	data['detail'] = entity.detail.toJson();
	return data;
}

messageInfoDetailFromJson(MessageInfoDetail data, Map<String, dynamic> json) {
	if (json['current'] != null) {
		data.current = json['current'] is String
				? int.tryParse(json['current'])
				: json['current'].toInt();
	}
	if (json['size'] != null) {
		data.size = json['size'] is String
				? int.tryParse(json['size'])
				: json['size'].toInt();
	}
	if (json['total'] != null) {
		data.total = json['total'] is String
				? int.tryParse(json['total'])
				: json['total'].toInt();
	}
	if (json['records'] != null) {
		data.records = (json['records'] as List).map((v) => MessageInfoDetailRecords().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> messageInfoDetailToJson(MessageInfoDetail entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['current'] = entity.current;
	data['size'] = entity.size;
	data['total'] = entity.total;
	data['records'] =  entity.records.map((v) => v.toJson()).toList();
	return data;
}

messageInfoDetailRecordsFromJson(MessageInfoDetailRecords data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['create_at'] != null) {
		data.createAt = json['create_at'].toString();
	}
	if (json['update_at'] != null) {
		data.updateAt = json['update_at'].toString();
	}
	if (json['receive_uid'] != null) {
		data.receiveUid = MessageInfoDetailRecordsReceiveUid().fromJson(json['receive_uid']);
	}
	if (json['release_user'] != null) {
		data.releaseUser = MessageInfoDetailRecordsReleaseUser().fromJson(json['release_user']);
	}
	if (json['desc'] != null) {
		data.desc = json['desc'].toString();
	}
	if (json['is_handled'] != null) {
		data.isHandled = json['is_handled'] is String
				? int.tryParse(json['is_handled'])
				: json['is_handled'].toInt();
	}
	if (json['is_finish'] != null) {
		data.isFinish = json['is_finish'] is String
				? int.tryParse(json['is_finish'])
				: json['is_finish'].toInt();
	}
	if (json['status'] != null) {
		data.status = json['status'] is String
				? int.tryParse(json['status'])
				: json['status'].toInt();
	}
	return data;
}

Map<String, dynamic> messageInfoDetailRecordsToJson(MessageInfoDetailRecords entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['create_at'] = entity.createAt;
	data['update_at'] = entity.updateAt;
	data['receive_uid'] = entity.receiveUid.toJson();
	data['release_user'] = entity.releaseUser.toJson();
	data['desc'] = entity.desc;
	data['is_handled'] = entity.isHandled;
	data['is_finish'] = entity.isFinish;
	data['status'] = entity.status;
	return data;
}

messageInfoDetailRecordsReceiveUidFromJson(MessageInfoDetailRecordsReceiveUid data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['create_at'] != null) {
		data.createAt = json['create_at'].toString();
	}
	if (json['uid'] != null) {
		data.uid = json['uid'] is String
				? int.tryParse(json['uid'])
				: json['uid'].toInt();
	}
	if (json['nick_name'] != null) {
		data.nickName = json['nick_name'].toString();
	}
	if (json['email'] != null) {
		data.email = json['email'].toString();
	}
	if (json['phone'] != null) {
		data.phone = json['phone'];
	}
	if (json['sex'] != null) {
		data.sex = json['sex'].toString();
	}
	if (json['real_name'] != null) {
		data.realName = json['real_name'].toString();
	}
	if (json['update_at'] != null) {
		data.updateAt = json['update_at'].toString();
	}
	if (json['role_int'] != null) {
		data.roleInt = json['role_int'];
	}
	if (json['avatar'] != null) {
		data.avatar = json['avatar'].toString();
	}
	if (json['birthday'] != null) {
		data.birthday = json['birthday'].toString();
	}
	if (json['location'] != null) {
		data.location = json['location'].toString();
	}
	return data;
}

Map<String, dynamic> messageInfoDetailRecordsReceiveUidToJson(MessageInfoDetailRecordsReceiveUid entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['create_at'] = entity.createAt;
	data['uid'] = entity.uid;
	data['nick_name'] = entity.nickName;
	data['email'] = entity.email;
	data['phone'] = entity.phone;
	data['sex'] = entity.sex;
	data['real_name'] = entity.realName;
	data['update_at'] = entity.updateAt;
	data['role_int'] = entity.roleInt;
	data['avatar'] = entity.avatar;
	data['birthday'] = entity.birthday;
	data['location'] = entity.location;
	return data;
}

messageInfoDetailRecordsReleaseUserFromJson(MessageInfoDetailRecordsReleaseUser data, Map<String, dynamic> json) {
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['create_at'] != null) {
		data.createAt = json['create_at'].toString();
	}
	if (json['uid'] != null) {
		data.uid = json['uid'] is String
				? int.tryParse(json['uid'])
				: json['uid'].toInt();
	}
	if (json['nick_name'] != null) {
		data.nickName = json['nick_name'].toString();
	}
	if (json['email'] != null) {
		data.email = json['email'].toString();
	}
	if (json['phone'] != null) {
		data.phone = json['phone'];
	}
	if (json['sex'] != null) {
		data.sex = json['sex'].toString();
	}
	if (json['real_name'] != null) {
		data.realName = json['real_name'].toString();
	}
	if (json['update_at'] != null) {
		data.updateAt = json['update_at'].toString();
	}
	if (json['role_int'] != null) {
		data.roleInt = json['role_int'];
	}
	if (json['avatar'] != null) {
		data.avatar = json['avatar'].toString();
	}
	if (json['birthday'] != null) {
		data.birthday = json['birthday'].toString();
	}
	if (json['location'] != null) {
		data.location = json['location'].toString();
	}
	return data;
}

Map<String, dynamic> messageInfoDetailRecordsReleaseUserToJson(MessageInfoDetailRecordsReleaseUser entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['id'] = entity.id;
	data['create_at'] = entity.createAt;
	data['uid'] = entity.uid;
	data['nick_name'] = entity.nickName;
	data['email'] = entity.email;
	data['phone'] = entity.phone;
	data['sex'] = entity.sex;
	data['real_name'] = entity.realName;
	data['update_at'] = entity.updateAt;
	data['role_int'] = entity.roleInt;
	data['avatar'] = entity.avatar;
	data['birthday'] = entity.birthday;
	data['location'] = entity.location;
	return data;
}